import requests from '@src/common/request'

export function getShopCartList(data) {
  return requests.post({
    url: '/mall/mobile/cart/query_list',
    data: data
  })
}

//更新商品数量
export function updateItemNum(cartUpdateGoodsNum) {
  return requests.post({
    url: '/mall/mobile/cart/update_item_num',
    data: {
      ...cartUpdateGoodsNum
    }
  })
}

//删除购物车商品
export function deleteItem(cartItemDel) {
  return requests.post({
    url: '/mall/mobile/cart/del_item',
    data: {
      ...cartItemDel
    }
  })
}

//批量删除购物车商品
export function batchDeleteItem(delList) {
  return requests.post( {
    url: '/mall/mobile/cart/batch_del_item',
    data: delList
  })
}

//获取购物车商品数量
export function cartListCount(data) {
  return requests.get( {
    url: '/mall/mobile/cart/count',
    params: data
  })

}

//改变选择状态
export function changeSelectState(cartChangeSelect) {
  return requests.post({
    url: '/mall/mobile/cart/change_select_status',
    data: cartChangeSelect
  })
}

//添加商品到购物车
export function addGoodsToCart(cartAddForm) {
  return requests.post( {
    url: '/mall/mobile/cart/add_item',
    data: cartAddForm
  })

}












